package com.xy.annotaion.handler.interceptor;

import com.xy.annotaion.handler.common.log.LogService;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * spring Aop 拦截器 其功能 待探索
 * 直接实现的 MethodInterceptor 不起作用，不会拦截所有方法的!!!
 *
 * @author Dell
 */
//@Component//not OK
public class TestAopMethodInterceptor implements MethodInterceptor, LogService {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        log("invoke TEST!!!");
        log(invocation);
        return invocation.proceed();
    }
}
